package com.lcxw.hxzb.friendcircle.project.system.service.impl;

import com.lcxw.hxzb.friendcircle.common.utils.DateUtils;
import com.lcxw.hxzb.friendcircle.project.system.domain.YwpdGameOrder;
import com.lcxw.hxzb.friendcircle.project.system.mapper.YwpdGameOrderMapper;
import com.lcxw.hxzb.friendcircle.project.system.service.IYwpdGameOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 游戏订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-15
 */
@Service
public class YwpdGameOrderServiceImpl implements IYwpdGameOrderService 
{
    @Autowired
    private YwpdGameOrderMapper ywpdGameOrderMapper;

    /**
     * 查询游戏订单
     * 
     * @param orderId 游戏订单ID
     * @return 游戏订单
     */
    @Override
    public YwpdGameOrder selectYwpdGameOrderById(Long orderId)
    {
        return ywpdGameOrderMapper.selectYwpdGameOrderById(orderId);
    }

    @Override
    public List<YwpdGameOrder> orderList(YwpdGameOrder ywpdGameOrder) {
        return ywpdGameOrderMapper.orderList(ywpdGameOrder);
    }

    /**
     * 查询游戏订单列表
     * 
     * @param ywpdGameOrder 游戏订单
     * @return 游戏订单
     */
    @Override
    public List<YwpdGameOrder> selectYwpdGameOrderList(YwpdGameOrder ywpdGameOrder)
    {
        return ywpdGameOrderMapper.selectYwpdGameOrderList(ywpdGameOrder);
    }

    @Override
    public List<YwpdGameOrder> selectOrderLists(Long userId) {
        return ywpdGameOrderMapper.selectOrderLists(userId);
    }

    /**
     * 新增游戏订单
     * 
     * @param ywpdGameOrder 游戏订单
     * @return 结果
     */
    @Override
    public int insertYwpdGameOrder(YwpdGameOrder ywpdGameOrder)
    {
        ywpdGameOrder.setCreateTime(DateUtils.getNowDate());
        return ywpdGameOrderMapper.insertYwpdGameOrder(ywpdGameOrder);
    }

    /**
     * 修改游戏订单
     * 
     * @param ywpdGameOrder 游戏订单
     * @return 结果
     */
    @Override
    public int updateYwpdGameOrder(YwpdGameOrder ywpdGameOrder)
    {
        return ywpdGameOrderMapper.updateYwpdGameOrder(ywpdGameOrder);
    }

    /**
     * 批量删除游戏订单
     * 
     * @param orderIds 需要删除的游戏订单ID
     * @return 结果
     */
    @Override
    public int deleteYwpdGameOrderByIds(Long[] orderIds)
    {
        return ywpdGameOrderMapper.deleteYwpdGameOrderByIds(orderIds);
    }

    /**
     * 删除游戏订单信息
     * 
     * @param orderId 游戏订单ID
     * @return 结果
     */
    @Override
    public int deleteYwpdGameOrderById(Long orderId)
    {
        return ywpdGameOrderMapper.deleteYwpdGameOrderById(orderId);
    }

    @Override
    public YwpdGameOrder selectMyMoney(Long userId) {
        return ywpdGameOrderMapper.selectMyMoney(userId);
    }
}
